﻿using FluentNHibernate.Mapping;
using System;

namespace Application_Core.Bestellung_Component.Data_Access_Layer
{
    public class AngebotMap : ClassMap<Angebot>
    {
        public AngebotMap()
        {
            Id(x => x.Id)
                .GeneratedBy.Identity()
                .Length(11);
            Map(x => x.Nummer)
                .Not.Nullable()
                .Length(11)
                .Unique();
            Map(x => x.GueltigAb)
                .Not.Nullable();
            Map(x => x.GueltigBis)
                .Nullable();
            Map(x => x.Preis)
                .Not.Nullable()
                .Precision(9).Scale(2);
            Map(x => x.KundeId)
                .Not.Nullable();
            Map(x => x.BauteilId)
                .Not.Nullable();
        }
    }
}
